/*
 * @Author: evanxu evanxu8023@163.com
 * @Date: 2022-07-20 19:07:06
 * @LastEditors: Evanxu-home evanxu8023@163.com
 * @LastEditTime: 2025-11-15 16:30:35
 * @FilePath: \program\hardware\key.h
 * @Description: 
 * 
 * Copyright (c) 2022 by evanxu evanxu8023@163.com, All Rights Reserved. 
 */
#ifndef __key_h_
#define __key_h_

/* 包含头文件 ----------------------------------------------------------------*/
#include "sys.h"

/* 类型定义 ------------------------------------------------------------------*/

/* 宏定义  ------------------------------------------------------------------*/
#define KEY_ADD_PIN							GPIO_PINS_8
#define KEY_ADD_GPIO						GPIOB
#define KEY_ADD_GPIO_CRM_CLK				CRM_GPIOB_PERIPH_CLOCK
#define READ_KEY_ADD						gpio_input_data_bit_read(KEY_ADD_GPIO, KEY_ADD_PIN)

#define KEY_CUT_PIN							GPIO_PINS_9
#define KEY_CUT_GPIO						GPIOB
#define KEY_CUT_GPIO_CRM_CLK				CRM_GPIOB_PERIPH_CLOCK
#define READ_KEY_CUT						gpio_input_data_bit_read(KEY_CUT_GPIO, KEY_CUT_PIN)

#define KEY_ENTER_PIN						GPIO_PINS_4
#define KEY_ENTER_GPIO						GPIOB
#define KEY_ENTER_GPIO_CRM_CLK				CRM_GPIOB_PERIPH_CLOCK
#define READ_KEY_ENTER						gpio_input_data_bit_read(KEY_ENTER_GPIO, KEY_ENTER_PIN)

#define KEY_SET_PIN							GPIO_PINS_7
#define KEY_SET_GPIO						GPIOB
#define KEY_SET_GPIO_CRM_CLK				CRM_GPIOB_PERIPH_CLOCK
#define READ_KEY_SET						gpio_input_data_bit_read(KEY_SET_GPIO, KEY_SET_PIN)

#define KEY_SENSOR_A_PIN                    GPIO_PINS_5
#define KEY_SENSOR_A_GPIO                   GPIOB
#define KEY_SENSOR_A_GPIO_CRM_CLK           CRM_GPIOB_PERIPH_CLOCK
#define READ_KEY_SENSOR_A                   gpio_input_data_bit_read(KEY_SENSOR_A_GPIO, KEY_SENSOR_A_PIN)

#define KEY_SENSOR_B_PIN                    GPIO_PINS_6
#define KEY_SENSOR_B_GPIO                   GPIOB
#define KEY_SENSOR_B_GPIO_CRM_CLK           CRM_GPIOB_PERIPH_CLOCK
#define READ_KEY_SENSOR_B                   gpio_input_data_bit_read(KEY_SENSOR_B_GPIO, KEY_SENSOR_B_PIN)

/* 函数声明 --------------------------------------------------------------------*/
void key_gpio_init(void);


#endif


